/*    */ package org.poebot.hal;
/*    */ 
///*    */ import java.awt.Container;
/*    */ import java.awt.Frame;
/*    */ import java.awt.event.ActionEvent;
/*    */ import java.awt.event.ActionListener;
/*    */ import javax.swing.BoxLayout;
/*    */ import javax.swing.JButton;
/*    */ import javax.swing.JDialog;
/*    */ import javax.swing.JProgressBar;
///*    */ import javax.swing.SwingUtilities;
/*    */ import org.apache.log4j.Logger;
import org.poebot.hal.BotTrainer;
import org.poebot.hal.BotTrainerListener;
/*    */ 
/*    */ public class TrainingProgressWindow extends JDialog
/*    */   implements ActionListener, BotTrainerListener
/*    */ {
/*    */   private static final long serialVersionUID = -4687259464546655085L;
/*    */   private JProgressBar progressBar;
/*    */   private JButton stopButton;
/*    */   private final BotTrainer trainer;
/* 82 */   private static Logger logger = Logger.getLogger(TrainingProgressWindow.class);
/*    */ 
/*    */   public TrainingProgressWindow(Frame parent, BotTrainer trainer)
/*    */   {
/* 24 */     super(parent, "Training Progress", false, parent.getGraphicsConfiguration());
/*    */ 
/* 26 */     this.progressBar = new JProgressBar();
/* 27 */     this.progressBar.setMaximum(100);
/* 28 */     this.progressBar.setMinimum(0);
/* 29 */     this.progressBar.setValue(0);
/* 30 */     this.stopButton = new JButton("Stop");
/* 31 */     this.stopButton.addActionListener(this);
/*    */ 
/* 33 */     getContentPane().setLayout(new BoxLayout(getContentPane(), 0));
/* 34 */     getContentPane().add(this.progressBar);
/* 35 */     getContentPane().add(this.stopButton);
/*    */ 
/* 37 */     setDefaultCloseOperation(2);
/*    */ 
/* 39 */     this.trainer = trainer;
/* 40 */     setSize(400, 200);
/* 41 */     setVisible(true);
/* 42 */     trainer.addListener(this);
/* 43 */     logger.debug("spawned training progress window.");
/*    */   }
/*    */ 
/*    */   public void actionPerformed(ActionEvent event)
/*    */   {
/* 50 */     if (event.getSource() == this.stopButton)
/*    */     {
/* 52 */       logger.info("Stopped training on file.");
/* 53 */       this.trainer.interrupt();
/*    */     }
/*    */   }
/*    */ 
/*    */   public void progressUpdate(int percent)
/*    */   {
/* 59 */     //Code removed because well, it didn't work.

/*    */   }
/*    */ 
/*    */   public void trainingComplete()
/*    */   {
/* 73 */     setVisible(false);
/* 74 */     dispose();
/*    */   }
/*    */ }

/* Location:           C:\workspace\dognuts\dognuts\dognuts.jar
 * Qualified Name:     org.dognuts.gui.TrainingProgressWindow
 * JD-Core Version:    0.6.0
 */